package com.hong.spring.utils;

import com.weibo.api.motan.common.MotanConstants;
import com.weibo.api.motan.util.MotanSwitcherUtil;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
 *
 * 功能描述: motan的配置
 *
 * @param:
 * @return:
 * @auther: csh
 * @date: 2021/2/1 11:58
 */
public class MotanServletContextListener implements ServletContextListener {
 
    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
    }
 
    @Override
    public void contextInitialized(ServletContextEvent event) {
        //这个时候spring已经初始化完成，调用以下的类来调整motan状态
        MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true);
    }
 
}